package MathHomeWorkTest;

import java.util.Scanner;

/*
5、从键盘接收一个正整数，该正整数作为行数，输出以下图形
    *
   ***
  *****
 *******
*********
 */
public class MathTest3 {
    public static void main(String[] args){
        Scanner s = new Scanner(System.in);
        System.out.println("请输入一个正整数：");
        int num = s.nextInt();
        for(int i = 1; i <=num; i++){
            for(int j = 0; j < num - i; j++){
                System.out.print(" ");
            }
            for(int k = 0; k < i*2-1; k++){
                System.out.print("*");
            }
            System.out.println();
        }
    }
}
